#!/bin/bash
cd /opt
yum update -y
yum -y groupinstall "Development tools" 
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel psmisc libffi-devel -y

wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xz

tar -xf Python-3.6.7.tar.xz

cd /opt/Python-3.6.7

./configure --prefix=/usr/local/python3

make && make install

ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3.6.7
ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip3.6.7

rm -rf /opt/Python-3.6.7
rm -rf /opt/Python-3.6.7.tar.xz
